﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


class ChangeBitValue
{
    static void Main(string[] args)
    {
        Console.WriteLine("Enter number N:");
        int n = Convert.ToInt32(Console.ReadLine());
        Console.WriteLine("Enter position P:");
        int position = Convert.ToInt32(Console.ReadLine());
        Console.WriteLine("Enter Value 0 or 1:");
        int value = Convert.ToInt32(Console.ReadLine());
        int masq = (value << position);
        int nAndMasq = (n | masq);
        //Console.WriteLine(nAndMasq);
        byte[] bytes = BitConverter.GetBytes(n);
        for (int i = 0; i < bytes.Length; i++) 
        {
            Console.WriteLine(bytes[i]);
        }
    }
}

